class GameMain1 extends eui.Component implements eui.UIComponent {
	public constructor() {
		super();
		this.skinName = "GameMain1Skin"

	}

	protected partAdded(partName: string, instance: any): void {
		super.partAdded(partName, instance);
	}

	private titleAin;
	private switch;
	private musicBtn;

	protected childrenCreated(): void {
		// 向上滑切换页面
		let langArr = [];
		this.music = Main;
		super.childrenCreated();
		this.playAnimation(this.titleAin, true);
		this.switch.addEventListener(egret.TouchEvent.TOUCH_MOVE, function (e) {
			langArr.push(e.stageY);

		}, this)
		this.switch.addEventListener(egret.TouchEvent.TOUCH_END, function (e) {

			if (langArr.length > 10 && langArr[0] > langArr[langArr.length - 1]) {
				SceneManger.createObj(this.stage).loadScene("GameMain2", GameMain2);

			}
			langArr = [];
		}, this)

	}

	private music;
	//设置循环播放
	private playAnimation(target: egret.tween.TweenGroup, isLoop: boolean): void {
		if (isLoop) {
			for (var key in target.items) {
				target.items[key].props = { loop: true };
			}
		}
		target.play();
	}
}